<template>
  <div>
    <el-dialog title="销售订单详情"  width="1200px" @open="open" class="icon-dialog" :visible.sync="show" :before-close="closeForm" append-to-body>
      <el-form ref="form" :model=" saleorderform " size="small" label-width="80px" :inline="true" class="header">
        <el-row>
          <el-col :span="12">
            <el-form-item label="下单日期:" class="no-wrap-label">{{ saleorderform.inDate }}</el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="客户订单号:" class="no-wrap-label" label-width="130px">{{ saleorderform.cusBillNo }}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="客户:" class="no-wrap-label">{{ saleorderform.cusTomer }}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="周数:" class="no-wrap-label" label-width="130px">{{ saleorderform.weekNo }}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="人员:" class="no-wrap-label">{{ saleorderform.user }}</el-form-item>
          </el-col>

        </el-row>

        <br />
      </el-form>

      <el-table :data="saleorderList" height="calc(100vh - 300px)">
        <el-table-column label="客户订单号" width="120" prop="cusBillNo"></el-table-column>
        <el-table-column label="客户件号" width="120" prop="cusPartNo"></el-table-column>
        <el-table-column label="TY件号" width="120" prop="tyPartNo"></el-table-column>
        <el-table-column label="数量" width="120" prop="qty"></el-table-column>
        <el-table-column label="含税单价" width="120" prop="taxPrice"></el-table-column>
        <el-table-column label="税率" width="120" prop="taxRate"></el-table-column>
        <el-table-column label="价税合计" width="120" prop="totalPrice"></el-table-column>
        <el-table-column label="船期" width="120" prop="shipDate"></el-table-column>
        <el-table-column label="船期（周数）" width="120" prop="shipWeek"></el-table-column>
        <el-table-column label="要货日期" width="120" prop="deliveDate"></el-table-column>
        <el-table-column label="计划出货日期（周数）" width="120" prop="deliveWeek"></el-table-column>
      </el-table>

    </el-dialog>

  </div>
</template>
<script>
import { detail  } from '@/api/app/saleorder'
export default {
	name:'saleOrderdetail',
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
      saleorderform:{},
      saleorderList:[],
		}
	},
	watch:{
		show(val){
			if(val){
			}
		}
	},
	methods: {
    open(){
      detail(this.info).then(res => {
        if (res.status == 200) {
          this.saleorderform = res.data.data;
          this.saleorderList = res.data.dataList;

        } else {
          this.$message.error('获取详情失败2，请稍后再试');
        }
      }).catch(error => {

        this.$message.error('获取详情失败，请稍后再试');
      });
    },
    closeForm(){
      this.$emit('update:show', false)
    }
  }
}
</script>
<style  lang="scss">
@import '@/assets/scss/common.scss';

/* 调整表单项间距（按需） */
.el-row {
  margin-bottom: 10px;
}
</style>
